// useTime -- using the first draft of the Time class
// compile usetime.cpp and mytime.cpp together

#include <iostream>
#include "mytime.h"

int main(){
    using std::cout;
    using std::endl;
    Time planning;
    Time coding(2, 40);
    Time fixing(5,55);
    Time total;

    cout << "planning time = ";
    planning.Show();
    cout << endl;

    cout << "coding time = ";
    coding.Show();
    cout << endl;

    cout << "fixing time = ";
    fixing.Show();
    cout << endl;

    total = coding.Sum(fixing);
    cout << "coding.Sum(fixing) = ";
    total.Show();
    cout << endl;

    // By operator to use
    cout << "\nBy operator to use\n";
    total = coding.operator+(fixing);   // function notation
    cout << "coding.operator+(fixing) = ";
    total.Show();
    cout << endl;
    total = coding + fixing;    // operator notation
    cout << "coding + fixing = ";
    total.Show();
    cout << endl;

    // use operator-()
    Time weeding(4, 35);
    Time waxing(2, 47);
    Time diff;
    diff = weeding - waxing;
    cout << "weeding - waxing = ";
    diff.Show();
    cout << endl;

    // use operator*()
    total = weeding + waxing;
    Time adjusted;
    adjusted = total * 1.5;
    cout << "total * 1.5 = ";
    adjusted.Show();
    cout << endl;

    // double * Time
    adjusted = 1.5 * weeding;
    cout << "1.5 * weeding = ";
    adjusted.Show();
    cout << endl;

    // Test operator>>()
    cout << "\nTest operator>>()\n";
    cout << "1.5 * weeding = " << 1.5 * weeding << endl;
    cout << "weeding - waxing = " << diff << endl;
    return 0;
}